<template>
  <div class="cu-common-layout">
    <div class="cu-common-layout-center">
      <el-row class="cu-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="5">
            <el-form-item label="校区品牌" prop="brand">
              <el-select v-model="query.brand" placeholder="请选择品牌" clearable>
                <el-option :key="item.id" :label="item.fullName" :value="item.enCode" v-for="item in brandOptions" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="校区阶段">
              <el-select v-model="query.campusLevel" placeholder="请选择校区阶段" clearable multiple>
                <el-option :key="item.id" :label="item.fullName" :value="item.enCode" v-for="item in levelOptions" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="校区状态" prop="">
              <el-select v-model="query.campusStatus" placeholder="请选择校区状态" clearable multiple>
                <el-option v-for="item in statusOptions" :key="item.id" :label="item.fullName" :value="item.enCode" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="管理区域">
              <el-select v-model="query.company" placeholder="请选择" clearable required :style="{ width: '100%' }">
                <el-option v-for="(item, index) in companyOptions" :key="index" :label="item.fullName" :value="item.enCode"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="省份" prop="provinceId">
              <custom-address v-model="query.provinceId" :level="1" placeholder="请选择省份" />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
              <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="cu-common-layout-main cu-flex-main">
        <div class="cu-common-head">
          <div>
            <el-button type="success" icon="el-icon-download" @click="exportData()">导出</el-button>
          </div>
          <div class="cu-common-head-right">
            <el-tooltip effect="dark" content="刷新" placement="top">
              <el-link icon="icon-ym icon-ym-Refresh cu-common-head-icon" :underline="false" @click="reset()" />
            </el-tooltip>
            <screenfull isContainer />
          </div>
        </div>
        <custom-table v-loading="listLoading" :data="list">
          <el-table-column prop="brandText" label="品牌" align="center" width="120" />
          <el-table-column prop="company" label="所属公司" align="center" width="200" />
          <el-table-column prop="province" label="省份" align="center" width="120" />
          <el-table-column prop="totalCampusCount" label="总校区数" align="center" width="120" />
          <el-table-column prop="insuredCampusCount" label="已买保险校区数" align="center" width="150" />
          <el-table-column prop="uninsuredCampusCount" label="未买保险校区数" align="center" width="150" />
          <el-table-column prop="insuranceRate" label="投保率(%)" align="center" width="120">
            <template slot-scope="scope">
              <el-tag :type="getInsuranceRateType(scope.row.insuranceRate)" size="mini">{{ scope.row.insuranceRate }}%</el-tag>
            </template>
          </el-table-column>
        </custom-table>
        <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
      </div>
    </div>
  </div>
</template>
<script>
export { default } from './index.js'
</script>
<style lang="scss" scoped>
@import url(index.scss);
</style>
